﻿
print 'hello world'
print "hello world"
print '''hello world'''
print """hello world"""

print 'I\'m OK'
print "I\'m OK"
print '''I\'m OK'''
print """I\'m OK"""

#print r'I'm OK' #there'll be error of grammar
print r"I'm OK"
print r'''I'm OK'''
print r"""I'm OK"""

print "python"*3
print "hello"+"world"
print "hello","world"

print u'中文'
print u'中'
print u'\u4e2d' # it will show 中

print ord('A')# ASCII A <-> 65
print chr(65) # 65 <-> ASCII A

print u'ABC'.encode('utf-8')
print u'中文'.encode('utf-8') # this is related to console char maybe
print u'中文'.encode('gb2312')

print len(u'ABC')
print len('ABC')
print len(u'中文')
print len('\xe4\xb8\xad\xe6\x96\x87')

print 'abc'.decode('utf-8')
print '\xe4\xb8\xad\xe6\x96\x87'.decode('utf-8')

# python string format : %s表示用字符串替换，%d表示用整数替换 %f 浮点数 %x十六进制整数

print '%2d-%02d' % (3,1)
print '%.2f' % 3.1415926

print 'Age: %s. Gender: %s' % (25,True)

print u'Hi, %s' % u'麦克'

print 'grouth rate: %d %%' % 7